package Project;

import java.util.ArrayList;
import ADTs.MenuItem;
/**
 * This is a abstract menu class.
 * 
 * @author	Brian Wetherbee
 * 			Ryan McNamara
 * 			Zeng Yang
 *
 */
public abstract class Menu extends UI { 
	private ArrayList<MenuItem> /*@ spec_public @*/ menuItems;
	private int menuSize;
	private int option;

	/*@ public invariant menuPosition != null; @*/

	public Menu(int size) {
		initComponents();
		menuSize = size;
		option = 0;
	}

	public void increaseHighlight() {
		option = (option + 1) % menuSize;
	}

	public void decreaseHighlight() {
		option = (option - 1) % menuSize;

		//this is here because % can apparently return negative values
		if(option < 0){
			option = menuSize - 1;
		}

	}

	public int getOption() {
		return option;
	}

	public void setOption(int newOpt) {
		option = newOpt;
	}

	public int getMenuSize(){
		return menuSize;
	}

	public abstract void select();

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
	// <editor-fold defaultstate="collapsed" desc="Generated Code">                          
	private void initComponents() {

		/*javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
		this.setLayout(layout);
		layout.setHorizontalGroup(
				layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGap(0, 400, Short.MAX_VALUE)
		);
		layout.setVerticalGroup(
				layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGap(0, 300, Short.MAX_VALUE)
		);*/
	}// </editor-fold>                        
	// Variables declaration - do not modify                     
	// End of variables declaration   

	public void updateInformation(){

	}

}
